<script type="text/javascript">
$(document).ready(function(){
	$('#SellerLoginForm').submit(function(){
			var sellerpassword = $('#sellerpassword').attr('value');
			var selleremail = $('#selleremail').attr('value');
			
			var dataString = 'selleremail='+selleremail+' & sellerpassword='+sellerpassword;
			
				$.ajax
					({
						type: "POST",
						url: "<?php
								echo $website_url . 'sellers/ajax_login';
							?>",
						data: dataString,
						cache: false,
						success: function(html)
						{
							if(html)
							{
								window.location.href = '<?php
								echo $website_url . 'sellers/dashboard';
							?>';
							}
							else
							{
								$('.error').html('Your login is failed. Please try again');
							}
						 
						}
					});
	});
});
</script>

<div class="login_main">
  <div class="login_main_left">
    <h2>Seller Login</h2>
    <br>
    <span class="error" style="color:#F00;"></span>
    <span>If you have an account with us, please log in.</span> <br>
    <?php echo $form->create('Seller', array('action'=>"login", 'id'=>'SellerLoginForm')) ?>
    <p>Email Address <br>
      <input id="selleremail" type="email" placeholder="me@example.com" autocomplete="off"   required="required" class="fie1" name="data[User][username]">
    </p>
    <br>
    <p>Password <br>
      <?php 
	        echo $this->Form->input('User.password',array('type' => 'password',
			 'placeholder'=>'Enter Password', 
	        'required'=>true,'class'=>'fie1','label'=>false,'id'=>'sellerpassword'));
	  ?> 
      </p>
    <input type="submit" class="sea_btn" id="sellerloginbutton" value="submit" name=""> 
    <div style="color: #CCCCCC;
    float: right;
    margin-top: 20px;
    width: 30%;">
    	<?php echo $html->link('Forget Password', array('controller'=>'users', 'action'=>'forgetpassword'), array('style'=>'color: #000;')); ?>
    </div>
    <?php echo $form->end(); ?> </div>
  <div class="login_main_right">
    <h2>New to Seller?</h2>
    <br>
    <p>Sign up here if you are signing up as a Seller.</p>
    <div class="seller_join">
      <?php
		echo $html->link('Join as Seller', array('controller'=>'sellers', 'action'=>'sellerjoin')); 
    ?>
    </div>
  </div>
</div>
